/**
 * Copyright (c) 2012 Axa Holding Belgium, SA. All rights reserved.
 * This software is the confidential and proprietary information of the AXA Group.
 */
package chabernac.android.wordbattle.rastersolver;

import java.util.Set;

import android.util.Log;

import chabernac.android.wordbattle.db.iStringDatabase;
import chabernac.android.wordbattle.model.WordRaster;

public class WordRasterSolver implements iWordRasterSolver {
  private final iStringDatabase myStringDatase;
  
  public WordRasterSolver( iStringDatabase aStringDatabase ) {
    super();
    myStringDatase = aStringDatabase;
  }

  @Override
  public Set<String> solve( WordRaster aWordRaster, int aMinWordSize ) {
    long t1 = System.currentTimeMillis();
    WordRasterSolverHelper theHelper = new WordRasterSolverHelper( myStringDatase, aMinWordSize, aWordRaster );
    theHelper.solve();
    long t2 = System.currentTimeMillis();
    Log.d( WordRasterSolver.class.getName(), "Solving wordraster took '" + (t2-t1) + " ms" );
    return theHelper.getResults();
  }

}
